class Uart:

    def __init__(self, framework):
        self.framework = framework
        self.command = {}
        self.ch0 = 0
        self.ch1 = 0
        self.ch2 = 0
        self.ch3 = 0
        self.ch4 = 0
        self.s1 = 3
        self.s2 = 3

    def uart_config(self, channel, baud_rate):
        self.command = {"type": "uart-config", "channel": channel, "rate": baud_rate}
        if self.framework.status:
            self.framework.write(self.command)

    def uart_read(self, channel):
        if channel == 1:
            self.uart_remote_control()

    def uart_remote_control(self):
        self.command = {"type": "uart-remote-control"}
        if self.framework.status:
            self.framework.write(self.command)

